//
//  YZip.h
//  mcf
//
//  Created by yuike6 yuike6 on 12-2-7.
//  Copyright (c) 2012年 yuike. All rights reserved.
//
//    Add all the files to you project, and and framework libz.1.2.3.dylib.
//
//    include YZip.h 
//    using #import "YZip.h" 
//
//    * create zip file
//     YZip* zipFile = [[YZip alloc] init];
//     [zipFile CreateZipFile2:@"zipfilename"]; // A
//    OR
//     [[zipFile CreateZipFile2:@"zipfilename" Password:@"your password"];// if password needed, 
//     //empty password will get same result as A
//     
//     [zipFile addFileToZip:@"fullpath of the file" newname:@"new name of the file without path"];
//     ....add any number of files here
//     [zipFile CloseZipFile2];
//     [zipFile release]; // remember to release the object
//     
//    * unzip compressed file
//     YZip* zipFile = [[YZip alloc] init];
//     [zipFile UnzipOpenFile:@"zip file name"]; // B (the zip got no password)
//     OR
//     [zipFile UnzipOpenFile:@"zip file name" Password:@"password" ];
//     
//     [zipFile UnzipFileTo:@"output path" overwrite:YES];
//     [zipFile UnzipCloseFile];
//     [zipFile release];
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "header.h"
#include "zip.h"
#include "unzip.h"


@protocol YZipDelegate <NSObject>
@optional
-(void) ErrorMessage:(NSString*) msg;
-(BOOL) OverWriteOperation:(NSString*) file;

@end


@interface YZip : NSObject {
@private
	zipFile		_zipFile;
	unzFile		_unzFile;
	
	NSString*   _password;
	id			_delegate;
}

@property (nonatomic, retain) id delegate;

-(BOOL) CreateZipFile2:(NSString*) zipFile;
-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password;
-(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname;
-(BOOL) CloseZipFile2;

-(BOOL) UnzipOpenFile:(NSString*) zipFile;
-(BOOL) UnzipOpenFile:(NSString*) zipFile Password:(NSString*) password;
-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite;
-(BOOL) UnzipCloseFile;
@end
